Consensus protocols ensure that data replicated across several nodes of a cluster of nodes remain in a consistent state and are widely used in distributed computing systems to achieve failure tolerance in clusters of computers. Consensus protocols can be used in a variety of systems, such as for example key/value stores, document stores, ensure that data distributed or replicated across multiple nodes of a cluster of nodes remain in a consistent state and are widely used in distributed computing systems to achieve failure tolerance in clusters of computers.
In general, each computing node in the cluster runs its own copy of a state machine for the cluster. Consensus involves multiple nodes (e.g. servers, computing systems, data stores, etc.) being in agreement on data values. Once a consensus is reached, that decision is final. Each node in a cluster can include a computing system with one or more programmable processors implementing a state machine and a log. Consensus is typically reached when a quorum (e.g. a majority, a plurality, or some other definition etc.) of the nodes in the cluster decides to accept the new state of the system (e.g., adding new data to a database table, setting a value for a key in key value stores, accepting a message in messaging systems, etc.). The state of the state machine presented by the cluster is based on the consensus such that clients interacting with the cluster perceive the nodes in the cluster as a single state machine having a consistent state. A consensus algorithm can ensure that if any of the state machines in a cluster applies a particular command at a particular point in a series of commands, none of the other state machines in the cluster will apply a different command at that same point in the series of commands. Well-known examples of consensus protocols include Paxos and RAFT.